import request from '@/utils/request.js'

// 手机号登录
const loginMobile = data => {
	return request.post('/api/auth/loginMobile', data);
};

// 微信登录
const wxLogin = data => {
	return request.post('/api/auth/wxLogin', data);
};

// 校验手机号码是否被其他微信号绑定,true表示绑定 false表示未绑定
const checkWxMobile = data => {
	return request.post('/api/auth/checkWxMobile', data);
};

// 校验手机号码是否已注册
const checkMobile = data => {
	return request.post('/api/auth/checkMobile', data);
};

// 移动端手机号登录/微信登陆之后绑定手机号
const appMobileLogin = data => {
	return request.post('/api/auth/appMobileLogin', data);
};

// 获取短信
const sendRegisterVerifyCode = data => {
	return request.post('/api/sms/sendRegisterVerifyCode', data);
}

// 首页信息
const appHomePage = params => {
	return request.get('/api/appHomePage', params);
}

// 获取用户信息
const getMemberDetail = params => {
	return request.get('/api/member', params);
}

// 获取未读消息数量
const getNoRedNum = params => {
	return request.get('/api/getNoRedNum', params);
}

// 获取消息列表
const getMessageList = params => {
	return request.get('/api/getMessageList', params);
}

// 读消息
const redMessage = data => {
	return request.post('/api/redMessage', data);
}

// 获取邀请链接
const getInviteLink = params => {
	return request.get('/api/getInviteLink', params);
}

export {
	loginMobile,
	wxLogin,
	checkWxMobile,
	checkMobile,
	appMobileLogin,
	sendRegisterVerifyCode,
	appHomePage,
	getMemberDetail,
	getNoRedNum,
	getMessageList,
	redMessage,
	getInviteLink
}